<?php

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('content-images-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
$this->_toolbar = array(
	'title'		=>	Yii::t('admin_news', 'Images Type Manager'),
	'buttons'	=>	array(
		CHtml::link(Yii::t('app','Delete'), "", array("id"=>"delete", "class"=>"button-s del", "onclick"=>"deleteAll('".Yii::app()->createUrl('/admin_news/ContentImages/delMulti')."','".Yii::t('app','Are you sure you want to delete item?')."')")),
		CHtml::link(Yii::t('app','Advanced Search'), "", array("id"=>"search", "class"=>"search-button button-s")),
	)
);
?>

<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('ext.widgets.iGridView', array(
	'id' => 'content-images-grid',
	'dataProvider' => $model->search(),
	'filter' => $model,
	'columns' => array(
		array(
			'name'=>'id',
			'htmlOptions'	=>	array(
				'width'	=>	'30',
				'align'	=>	'center'
			),
		),
		array(
			'type'	=>	'raw',
			'header'	=>'<div id="sl-row" onclick="checkAll(this.id)" status="1">Check</div>',
			'htmlOptions'	=>	array(
				'width'	=>	'50',
				'align'	=>	'center',
			),
			'value'	=>	'CHtml::checkBox("rad_ID[]", "", array("value"=>$data->id))'
		),
		array(
			'name'=>'name',
			'type'=>'raw',
			'value'=>'CHtml::link(CHtml::encode($data->name), array("contentImages/update","id"=>$data->id))'
		),
		'width',
		'height',
		'description',
		array(
			'class' => 'CButtonColumn',
		),
	),
)); ?>
